<script setup lang="ts">
import { getArticleCateService } from '@/apis/article/index'
import { ref } from 'vue'
defineProps({
  modelValue: {
    type: [Number, String]
  },
  width: {
    type: String
  }
})
const emit = defineEmits(['update:modelValue'])
const channelList = ref<any>([])
const getChannelList = async () => {
  const res = await getArticleCateService()
  channelList.value = res.data.data
}
getChannelList()
</script>
<template :model="channelList">
  <!-- label是展示给用户看的 value是收集起来提交给后台的 -->
  <el-select style="width: 200px" :modelValue="modelValue" @update:modelValue="emit('update:modelValue', $event)">
    <el-option v-for="channel in channelList" :key="channel.id" :label="channel.cate_name"
      :value="channel.id"></el-option>
  </el-select>
</template>
